<template>
    <div id="tab-bar">
        <div id="tab-bar-item" v-for="item in tabbardata">
            <a :href="item.url">
                <slot name="svg">
                    <!-- <icon :class="item.icon"></icon>图标</icon> -->
                </slot>
                <slot name="text">
                    <span>{{item.text}}</span>
                </slot>
            </a>
        </div>
    </div>
</template>

<script>


export default {
    name:'tabbar',
    props:{//接收父组件传参，并给个默认值
        tabbardata:{
            type:Array,
            required:true,
            default:[
                {
                    icon:'',
                    text:'首页',
                    url:'/'
                },
                {
                    icon:'',
                    text:'分类',
                    url:'/'
                },
                {
                    icon:'',
                    text:'购物车',
                    url:'/'
                },
                {
                    icon:'',
                    text:'我的',
                    url:'/'
                }
            ]
        }
    },
    data() {
        return {
          
        }
    },
}
</script>

<style scoped>
#tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 49px;
    line-height: 49px;
    background: #b9b5b5;
}
#tab-bar-item {
    flex: 1;
    text-align: center;
}
#tab-bar-item a {
    text-decoration:none;
    color: white;
}
</style>